← Index
NYTProf Performance Profile   
For /usr/share/koha/opac/cgi-bin/opac/opac-search.pl
  Run on Tue Oct 15 11:58:52 2013
Reported on Tue Oct 15 12:02:29 2013

Filename(eval 1109)[/usr/share/perl/5.10/CGI.pm:869]
StatementsExecuted 60 statements in 301µs
Eval Invoked At/usr/share/perl/5.10/CGI.pm line 869
Sibling evals1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
222380µs4.08msCGI::::urlCGI::url
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1
# spent 4.08ms (380µs+3.70) within CGI::url which was called 2 times, avg 2.04ms/call: # once (239µs+3.19ms) by main::RUNTIME at line 832 of CGI.pm # once (141µs+508µs) by main::RUNTIME at line 629 of /usr/share/koha/opac/cgi-bin/opac/opac-search.pl
package CGI; sub url {
2216µs220µs my($self,@p) = self_or_default(@_);
# spent 20µs making 2 calls to CGI::self_or_default, avg 10µs/call
3233µs2246µs my ($relative,$absolute,$full,$path_info,$query,$base,$rewrite) =
# spent 246µs making 2 calls to CGI::Util::rearrange, avg 123µs/call
4 rearrange(['RELATIVE','ABSOLUTE','FULL',['PATH','PATH_INFO'],['QUERY','QUERY_STRING'],'BASE','REWRITE'],@p);
522µs my $url = '';
624µs $full++ if $base || !($relative || $absolute);
722µs $rewrite++ unless defined $rewrite;
8
9220µs2342µs my $path = $self->path_info;
# spent 321µs making 1 call to CGI::AUTOLOAD # spent 22µs making 1 call to CGI::path_info
10218µs2337µs my $script_name = $self->script_name;
# spent 317µs making 1 call to CGI::AUTOLOAD # spent 20µs making 1 call to CGI::script_name
11221µs424µs my $request_uri = unescape($self->request_uri) || '';
# spent 15µs making 2 calls to CGI::Util::unescape, avg 7µs/call # spent 9µs making 2 calls to CGI::request_uri, avg 5µs/call
12217µs2487µs my $query_str = $self->query_string;
# spent 322µs making 1 call to CGI::AUTOLOAD # spent 165µs making 1 call to CGI::query_string
13
1423µs my $rewrite_in_use = $request_uri && $request_uri !~ /^\Q$script_name/;
152900ns undef $path if $rewrite_in_use && $rewrite; # path not valid when rewriting active
16
1722µs my $uri = $rewrite && $request_uri ? $request_uri : $script_name;
18214µs23µs $uri =~ s/\?.*$//s; # remove query string
# spent 3µs making 2 calls to CGI::CORE:subst, avg 2µs/call
1925µs $uri =~ s/\Q$ENV{PATH_INFO}\E$// if defined $ENV{PATH_INFO};
20# $uri =~ s/\Q$path\E$// if defined $path; # remove path
21
2223µs if ($full) {
23219µs2312µs my $protocol = $self->protocol();
# spent 242µs making 1 call to CGI::AUTOLOAD # spent 70µs making 1 call to CGI::protocol
2422µs $url = "$protocol://";
25222µs4354µs my $vh = http('x_forwarded_host') || http('host') || '';
# spent 252µs making 1 call to CGI::AUTOLOAD # spent 102µs making 3 calls to CGI::http, avg 34µs/call
26211µs22µs $vh =~ s/\:\d+$//; # some clients add the port number (incorrectly). Get rid of it.
# spent 2µs making 2 calls to CGI::CORE:subst, avg 1µs/call
2723µs if ($vh) {
28 $url .= $vh;
29 } else {
30210µs2141µs $url .= server_name();
# spent 137µs making 1 call to CGI::AUTOLOAD # spent 4µs making 1 call to CGI::server_name
31 }
3229µs28µs my $port = $self->server_port;
# spent 8µs making 2 calls to CGI::server_port, avg 4µs/call
3327µs $url .= ":" . $port
34 unless (lc($protocol) eq 'http' && $port == 80)
35 || (lc($protocol) eq 'https' && $port == 443);
3621µs return $url if $base;
3723µs $url .= $uri;
38 } elsif ($relative) {
39 ($url) = $uri =~ m!([^/]+)$!;
40 } elsif ($absolute) {
41 $url = $uri;
42 }
43
4422µs $url .= $path if $path_info and defined $path;
4524µs $url .= "?$query_str" if $query and $query_str ne '';
462800ns $url ||= '';
47216µs26µs $url =~ s/([^a-zA-Z0-9_.%;&?\/\\:+=~-])/sprintf("%%%02X",ord($1))/eg;
# spent 6µs making 2 calls to CGI::CORE:subst, avg 3µs/call
48228µs return $url;
49}
50
51
52;